﻿<!DOCTYPE HTML>
<html lang="zh">
<head>
<title>设置驱动器卷标 - 语法 &amp; 使用 | AutoHotkey v2</title>
<meta name="description" content="The 设置驱动器卷标 function changes the volume label of the specified drive." />
<meta name="ahk:equiv-v1" content="commands/Drive.htm#Label" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
<script type="text/javascript">$(function(){0<=window.navigator.userAgent.toLowerCase().indexOf("ucbrowser")&&CaoNiMaDeUc()})</script>
</head>
<body>

<h1>设置驱动器卷标</h1>

<p>更改指定驱动器的卷标签.</p>

<pre class="Syntax"><span class="func">设置驱动器卷标</span> Drive <span class="optional">, NewLabel</span></pre>

<h2 id="Parameters">参数</h2>
<dl>
    <dt>Drive</dt>
    <dd>
        <p>类型: <a href="../Concepts.htm#strings">字符串</a></p>
        <p>驱动器字母后跟着冒号和可选的反斜杠(也可能对 UNC 路径和映射驱动器有效).</p>
    </dd>
    <dt>NewLabel</dt>
    <dd>
        <p>类型: <a href="../Concepts.htm#strings">字符串</a></p>
        <p>要设置的新标签. 如果省略, 驱动器将没有标签.</p>
    </dd>
</dl>

<h2 id="Error_Handling">错误处理</h2>
<p>失败时抛出异常.</p>

<h2 id="Related">相关</h2>
<p><a href="DriveGetLabel.htm">获取驱动器卷标</a>, <a href="Drive.htm">驱动器函数</a></p>

<h2 id="Examples">示例</h2>
<div class="ex" id="ExBasic">
<p><a href="#ExBasic">#1</a></p>
<pre>设置驱动器卷标("C:", "Seagate200")</pre>
</div>

</body>
</html>